﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;


namespace ASEPMainProgram.Entities.MainFrame
{
    /// <summary>
    /// 分组实体类
    /// </summary>
    public class GroupEntity
    {
        /// <summary>
        /// 分组ID
        /// </summary>
        [Key]
        [Column(TypeName = "varchar(32)")]
        public string GroupId { get; set; }
        /// <summary>
        /// 分组名称
        /// </summary>
        [Required]
        [Column(TypeName = "varchar(32)")]
        public string GroupName { get; set; }
        /// <summary>
        /// 分组类型
        /// </summary>
        [Required]
        public GroupType GroupType { get; set; }
        /// <summary>
        /// 分组类型
        /// </summary>
        public int IsDeleted { get; set; }


        /// <summary>
        /// 
        /// </summary>
        public GroupEntity()
        {
            GroupId = "";
            GroupName = "";
            GroupType = 0;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="id">分组id</param>
        /// <param name="name">分组名称</param>
        /// <param name="groupType">分组类型</param>
        public GroupEntity(string id, string name, GroupType groupType)
        {
            GroupId = id ?? "";
            GroupName = name ?? "";
            GroupType = groupType;
        }
    }


    /// <summary>
    /// 组别类型
    /// </summary>
    public enum GroupType
    {
        /// <summary>
        /// 根节点
        /// </summary>
        RootGroup = 1,
        /// <summary>
        /// 注册组
        /// </summary>
        RegGroup = 2,
        /// <summary>
        /// 管理分组
        /// </summary>
        ManangerGroup = 3,
        /// <summary>
        /// 
        /// </summary>
        Unknown = 0
    }
}
